package com.istock.base.handler;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.istock.base.dbmigr.model.MigrationCallback;
import com.istock.base.test.dao.ConfigInfoMapper;
import com.istock.base.test.model.ConfigInfo;

import lombok.extern.slf4j.Slf4j;

/**
 * @author 使用mybatis-plus访问数据库的示例
 *
 */
@Component("step2DO")
@Slf4j
public class Step2DOCallback implements MigrationCallback {

	@Autowired
	private ConfigInfoMapper mapper;
	
	@Override
	public void pre() {
		log.info("this is the pre in callback");
		ConfigInfo config = new ConfigInfo();
		config.setConfigKey("senvon");
		config.setConfigName("admin");
		config.setConfigType(1);
		config.setCreateBy("senvon");
		config.setCreateTime(new Date());
		config.setUpdateBy("senvon update");
		config.setUpdateTime(new Date());
		config.setConfigValue("senvon value");
		config.setRemark("senvon remark");
		mapper.insert(config);
	}

}
